import React, { Suspense } from 'react';
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom';
import './assets/style/view/index.css';
// import Index from './view/index/index';
const Index = React.lazy(() => import('./view/index/index'));
// import Login from './view/login';
const Login = React.lazy(() => import('./view/login'));

const App = (props) => {
  console.log('app props', props);
  return (
    <Router>
      <Suspense
        fallback={
          // 首屏加载
          <div className="shouping">
            <div className="wrapper">
              <div className="belt">
                <div className="t" style={{ '--index': '0' }}></div>
                <div className="t" style={{ '--index': '1' }}></div>
                <div className="t" style={{ '--index': '2' }}></div>
                <div className="t" style={{ '--index': '3' }}></div>
                <div className="t" style={{ '--index': '4' }}></div>
                <div className="t" style={{ '--index': '5' }}></div>
                <div className="t" style={{ '--index': '6' }}></div>
                <div className="t" style={{ '--index': '7' }}></div>
                <div className="t" style={{ '--index': '8' }}></div>
                <div className="t" style={{ '--index': '9' }}></div>
              </div>
              <div className="box" style={{ '--index': '0' }}></div>
              <div className="box" style={{ '--index': '1' }}></div>
              <div className="box" style={{ '--index': '2' }}></div>
              <div className="box" style={{ '--index': '3' }}></div>
              <div className="box" style={{ '--index': '4' }}></div>
            </div>
          </div>
        }
      >
        <Redirect from="/admin/personalInfo/" to="/admin/" />
        <Redirect from="/" to="/admin/personalInfo/" />
        <Route path="/admin/" component={Index} />
        <Route path="/login/" exact component={Login} />
      </Suspense>
    </Router>
  );
};

export default App;
